Importing Access Files into Table Editor

The Table Editor does not let you import Access database files. The steps below, however, outline a way to convert an Access database (MDB) into dBASE IV (DBF) format so it can then be imported into Table Editor.

In this example, the original Access database is called PICLASS.MDB and contains a table called classcodes.

Note   The file name should be in 8.3 format, such as FILENAME.DBF.

Because the example requires a new database file from Access, create BLANK.DBF as a dBASE IV template. Do this by opening the default GENERALT.DFB file and removing the existing tables. This lets you import an empty file with the Documaker table format into Access.

Importing the DBF file

To append an Access database to a DBF table, you import the DBF file. Follow these steps to import BLANK.DBF from the table directory into Access as a new database.

Open Access, select the Create New Database Using Blank Database option.

Import BLANK.DBF by selecting the File, Get External Data option. Then choose Import.

Point to the BLANK.DBF file, setting the Files of Type field to dBASE IV (*.dbf), then choose Import. Click Ok if there is a warning message.

Modifying your database

To modify your database to match the BLANK.MDB file, open the existing database (PICLASS) in Access in Design View and make these changes:

Remove any primary key.

Change the field names to match the Documaker table format.

TABLE_NAME

ENTRY_NAME

DESCRIP

Change the data type to Text for the three fields.

Make sure the Table Field’s properties match the following:

 

Field

Size

Other properties

TABLE_NAME

40

None set.

ENTRY_NAME

40

None set.

DESCRIP

248

None set.

Note   When changing these field lengths, make sure there is no loss of data.

Change all the TABLE_NAME fields to the same value, such as “CLASSCOD”.

If there are a large number of records in the database, it may be easier to open an Excel spreadsheet, create a field called CLASSCOD, and drag the fill box down to the desired number of records in the table. You can then cut and paste from the Excel file into the TABLE_NAME column.

Combining the databases

Follow these steps to combine the databases:

Open BLANK.MDB and select the File, Get External Data, Import option. Then select the existing database (MDB file) and import.

Select the desired table from the Import Objects box (modified in previous steps). Under Objects, select Queries. Then create the query in design view.

In the Show Tables field select desired table (CLASSCODES), click Add, then Close.

Click on the asterisk (*) and drag it to the Field box. This selects all the fields in the table. Then choose the Query, Append Query option.

Select the table to append to (BLANK) and run the query by clicking the red exclamation mark (!) on the tool bar. Then exit the query.

In the new DB table (BLANK), insert a new record with the table name identifier, such as classcod in the ENTRY_NAME field, and the number (1) in the DESCRIP field. Then sort the table by selecting the TABLE_NAME field and clicking on the Sort Ascending button. The new record is now the first record. Delete the original table (CLASSCODES).

Exporting the appended database

To export the appended database to the table directory, choose File, Export, and select dBASE IV (dbf) as the file type. Point to the table directory in the MRL where you want the database exported to.